-- GENERATED SPELL FOR [Caedakar the Vicious] --


function spell0_3900(pUnit, Event) --@Healing Wave,Heal--
pUnit:FullCastSpellOnTarget(913,pUnit)
pUnit:RegisterEvent('Sorts_3900', 3000, 1)
end

function spell1_3900(pUnit, Event) --@Lightning Bolt,n/a--
pUnit:FullCastSpellOnTarget(9532,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_3900', 3000, 1)
end

function spell2_3900(pUnit, Event) --@Lightning Shield,Self--
pUnit:FullCastSpellOnTarget(905,pUnit)
pUnit:RegisterEvent('Sorts_3900', 542, 1)
end

function Sorts_3900(pUnit, Event)
local choix_sorts_3900 = math.random(0, 2)
if choix_sorts_3900 == 0 then
pUnit:RegisterEvent('spell0_3900', 1, 1)
end
if choix_sorts_3900 == 1 then
pUnit:RegisterEvent('spell1_3900', 1, 1)
end
if choix_sorts_3900 == 2 then
pUnit:RegisterEvent('spell2_3900', 1, 1)
end
end

function mob3900_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_3900', math.random(1500, 3000), 1)
end

function mob3900_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob3900_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob3900_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(3900, 1, 'mob3900_Action')
RegisterUnitEvent(3900, 2, 'mob3900_Leave')
RegisterUnitEvent(3900, 3, 'mob3900_Kill')
RegisterUnitEvent(3900, 4, 'mob3900_Die')
